<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!-- 引用一个片段 -->
<div th:replace="~{fragments/header :: header}"></div>

<h2 th:text="${userModel.title}"></h2>

<div>
    <a href="/users/form.html" th:href="@{/users/form}">新增用户</a>
</div>

<table border="1">
    <thead>
    <tr>
        <td>id</td>
        <td>email</td>
        <td>name</td>
        <td>操作</td>
    </tr>
    </thead>
    <tr th:if="${userModel.userList.size()} eq 0">
        <td colspan="3">没有用户信息!</td>
    </tr>
    <tr th:each="user : ${userModel.userList}">
        <th th:text="${user.id}"></th>
        <th th:text="${user.email}"></th>
        <th th:text="${user.name}"></th>
        <th><a th:href="@{'/users/' + ${user.id}}">查看</a></th>
    </tr>


</table>

<!-- 引用一个片段 -->
<div th:replace="~{fragments/footer :: footer}"></div>
</body>
</html>